package org.leaf.green.b2b

class MarketPriceApproval { //市场价格审核表

    Region  region          //区域
    Date date               //日期
    Boolean approved        //审批状态
    Date dateCreated        //创建日期
    Date lastUpdated        //修改日期

    static hasMany = [details : MarketPriceApprovalDetail]

    static constraints = {
        region(nullable:false)
        date(nullable:false, unique : 'region')
        approved(nullable:false)
    }

    String toString(){
        return "${date.format('yyyy-MM-dd')}"
    }

    static mapping = {
        table 'B2B_MARKET_PRICE_APPROVAL'
        details cascade:"all-delete-orphan", sort:"serialNumber", batchSize: 100
    }
}
